package cn.tedu.controller;

import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

@RestController
@RequestMapping("/num")
public class NumController {

    @GetMapping("/show.do")
    public ModelAndView num(){
        return new ModelAndView("num");
    }

    @PostMapping("/add.do")
    public ModelAndView add(int num1, int num2, ModelMap map){
        map.put("res",(num1+num2)+"");
        return new ModelAndView("result");
    }



}
